<?php 
session_start();
?>
<?php 
include_once './util/ArrayList.php';
include_once './util/db/model/Product.php';
include_once './util/db/model/ProdType.php';
include_once './util/db/model/ProdAttr.php';
include_once './util/db/model/ProdSubType.php';
include_once './util/db/model/SupplierBrand.php';
include_once './util/db/model/ProductSearchPara.php';
include_once './util/db/service/ProductDBUtil.php';
include_once './util/db/service/ProdAttrDBUtil.php';
include_once './util/db/service/OrderListDBUtil.php';
include_once './util/db/service/ProdTypeDBUtil.php';
include_once './util/db/service/SupplierBrandDBUtil.php';


?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/supplier.dwt" codeOutsideHTMLIsLocked="false" -->

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<!-- InstanceBeginEditable name="doctitle" -->

<title>無標題文件</title>

<!-- InstanceEndEditable -->

<style type="text/css">

<!--

#cantainer {

	width: 955px;

	margin-right: 33px;

	margin-left: 33px;

}

#header {

	width: 955px;

	margin-bottom: 10px;

	background-image: url(../../images/top_bg.png);

	height: 82px;

}

#body {

	width: 955px;

	margin-bottom: 10px;

}

#footer {

	width: 955px;

}

.style2 {color: #666666;

	font-size: 12px;

}

#contant_list {

	float: left;

	width: 180px;

	margin-right: 10px;

}

.style17 {color: #74B9E5; font-size: 14px; }

.style43 {font-size: 12px; color: #666666; font-weight: bold; }

#contant_body {

	float: right;

	width: 765px;

}

-->

</style>

<!-- InstanceBeginEditable name="head" -->

<style type="text/css">

<!--

#contant_body_body {

	width: 765px;

	margin-bottom: 10px;

}

#contant_body_hearder {

	background-image: url(../../admin/images/admin_inventory_list_header.png);

	height: 62px;

	width: 765px;

	margin-bottom: 10px;

}

.style16 {font-size: 14px}

.style45 {color: #000000}

#contant_body_1_1 {

	margin: 10px;

	height: 25px;

	width: 737px;

	background-image: url(../../admin/images/admin_inventory_search_text.png);

}

#contant_body_1_2 {	width: 737px;

	margin-right: 10px;

	margin-bottom: 10px;

	margin-left: 10px;

}

#contant_body_1_3 {

	height: 25px;

	width: 737px;

	margin-right: 10px;

	margin-bottom: 10px;

	margin-left: 10px;

	background-image: url(../../admin/images/admin_inventory_searcho_text.png);

}

#contant_body_1_4 {	width: 737px;

	margin-right: 10px;

	margin-bottom: 10px;

	margin-left: 10px;

}

-->

</style>

<!-- InstanceEndEditable -->
<script src="../../admin/js/jquery.js" type="text/javascript"></script>
<script src="../../admin/js/jquery.alerts/jquery.alerts.js" type="text/javascript"></script>
<script src="../../admin/js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script charset="utf-8" src="../../admin/js/utils.js"></script>
<script charset="utf-8" src="../../admin/js/validate.js"></script>
<script type="text/javascript" src="../../admin/js/global.js"></script>

<link rel="stylesheet" type="text/css" href="../../admin/css/jquery-ui-1.8.13.custom.css"></link>
<link rel="stylesheet" type="text/css" href="../../admin/css/validate.css"></link>
<link href="../../admin/css/jquery.ui.theme.css" rel="stylesheet" type="text/css"/>
<script src="../../admin/js/jquery-ui.min.js"></script>
<script src="../../admin/js/jquery.ui.datepicker-zh-TW.js"></script>
<script>
function checkform(form) {
	return $.validator.validateForm(form);
}
function procDate()
{
	     $('.dateCss').each(function(index) {
			   $(this).datepicker({
				 			rangeSelect: true,
							dateFormat: 'yy/mm/dd',
							changeMonth: true,
							changeYear: true,
							inline: true,
							buttonImageOnly: true,
							 buttonImage: '../../images/ico-date.png'
		
			});
        });

}

$(document).ready(function () {
		procDate();

		
	  $('select#pt_id').change(function (){
	         $.ajax({
	             url: '../../admin/inventory/ajax.php',
	             cache: false,
	             dataType: 'html',
	                 type:'POST',
	             data: { pt_id: $('select#pt_id').val(),
	            		 type: 'action1'
		             },
	             error: function(xhr) {
	               alert('Ajax request 發生錯誤');
	             },
	             success: function(response) {
	                       $("#prodSubTypeSpan").html(response);
	              
	             }
	         });
	  });
	  $('select#pt_id').trigger('change');
	});
	</script>

</head>



<body>

<table width="1024" align="center" cellpadding="0" cellspacing="0">

  <tr>

    <td><div id="cantainer">

      <div id="header"></div>

      <div id="body">

        <div id="contant_list">
        <?php include_once './template/Category.php';?>
        </div>
        <!-- InstanceBeginEditable name="EditRegion1" -->

        <div id="contant_body">

          <div id="contant_body_hearder"></div>

          <div id="contant_body_body">

            <table cellpadding="0" cellspacing="0">

              <tr>

                <td colspan="3"><img src="../../member/img/member_body_up.jpg" width="765" height="9" /></td>

              </tr>

              <tr>

                <td width="4" background="../../member/img/member_body_left.jpg">&nbsp;</td>

                <td width="757"><div id="contant_body_1_1"></div>

                    <div id="contant_body_1_2">

                      <table width="737" cellspacing="0" cellpadding="5">

                        <tr>

                          <td width="352">
                                      <form id="form1" name="form1" method="post" action="./supplier_inventory_search_list.php" onsubmit="return checkform(this)">
                          

                              <label>

                              <input  type="text" id="p_name" name="p_name" size="50" class="not-null:true"/>

                              </label>

                          </td>

                          <td width="363">

                              <label>

                              <input type="submit" name="button" id="button" value="搜尋" />

                              </label>

                          </form></td>

                        </tr>

                      </table>

                    </div>

                  <div id="contant_body_1_3"></div>

                  <div id="contant_body_1_4">
			<form id="form2" name="form2" method="post" action="./supplier_inventory_search_list.php">
                      <table width="737" cellspacing="0" cellpadding="5">

                        <tr>

                          <td class="style16">上架日期</td>

                          <td class="style16">

                              <label>

                              <input name="add_date" type="text" id="add_date" size="10" class="dateCss" />

                              </label>
                         </td>

                        </tr>

                        <tr>

                          <td width="68" class="style16">產品分類</td>

 
                        <td width="647" bgcolor="#DCF6F4" class="style16">
                            <label>
                             <select name="pt_id" id="pt_id">
                             <?php                              
								$prodTypeDBUtil=new ProdTypeDBUtil();
								$array= $prodTypeDBUtil->queryAll();
								for($i = 0; $i < $array->size (); $i ++) {
									$prodType=$array->get($i);
							?>
							<option value="<?php echo $prodType->getPt_id()?>"><?php echo $prodType->getType() ?></option>
							<?php 								
								}                           
                             ?>                           
                             </select>
                            </label>
                            <label>
                            <span id="prodSubTypeSpan"></span>
                            </label>

                          </form></td>

                        </tr>

                        <tr>

                          <td bgcolor="#DCF6F4" class="style16">商品品牌</td>

                          <td bgcolor="#DCF6F4" class="style16">

                              <label>
                           <select name="sb_id" id="sb_id">
                              <?php                              
								$supplierBrandDBUtil=new SupplierBrandDBUtil();
								$supplierBrandArray= $supplierBrandDBUtil->queryAll();
								for($i = 0; $i < $supplierBrandArray->size (); $i ++) {
									$supplierBrand=$supplierBrandArray->get($i);
							?>
							<option value="<?php echo $supplierBrand->getSb_id()?>"><?php echo $supplierBrand->getLogo_name() ?></option>
							<?php 								
								}                           
                             ?>   
                             </select>                        
                              </label>

                          </td>

                        </tr>

                        <tr>

                        <td bgcolor="#DCF6F4" class="style16">販售方式</td>
                        <td bgcolor="#DCF6F4" class="style16">
                            <label>
                            <input type="checkbox" name="sell_mode[]" id="sell_mode1" value="1"/>
                              正品
                              <input type="checkbox" name="sell_mode[]" id="sell_mode2" value="2"/>
                            </label>
                          特價
                          <label></label>
                          <label>
                            <input type="checkbox" name="sell_mode[]" id="sell_mode3" value="3"/>
                            </label>
                          <label>預售 </label>
                          <label>
                            <input type="checkbox" name="sell_mode[]" id="sell_mode4" value="4"/>
                            </label>
                          下架
                        </td>
                        </tr>

                        <tr>

                          <td colspan="2" align="center" class="style16">

                              <label>

                              <input type="submit" name="button2" id="button2" value="搜尋" />

                              </label>

                              <label></label>

                          </form></td>

                        </tr>

                      </table>

                  </div></td>

                <td width="4" background="../../member/img/member_body_right.jpg">&nbsp;</td>

              </tr>

              <tr>

                <td height="9" colspan="3"><img src="../../member/img/member_body_down.jpg" width="765" height="9" /></td>

              </tr>

            </table>

          </div>

        </div>

        <!-- InstanceEndEditable --></div>

      <div id="footer">

        <?php include_once './template/footer.php';?>

      </div>

      </div></td>

  </tr>

</table>

</body>

<!-- InstanceEnd --></html>
